package com.example.dayu521.sg_oss.service;

import com.example.dayu521.sg_oss.domain.Trade;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.dayu521.sg_oss.domain.donain_mid.TradeParam;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;
import org.example.dayu521.ORExecption;

/**
 * @author hasee
 * @description 针对表【t_trade】的数据库操作Service
 * @createDate 2023-09-04 15:40:43
 */

@LocalTCC
public interface TradeService extends IService<Trade> {


    @Override
    @TwoPhaseBusinessAction(name = "trade_svc",
            commitMethod = "save_commit",
            rollbackMethod = "save_rollback",
            commitArgsClasses= Trade.class,
            rollbackArgsClasses = Trade.class)
    boolean save(@BusinessActionContextParameter(paramName = "params")Trade entity);

    boolean save_commit(@BusinessActionContextParameter(paramName = "params")Trade entity);

    boolean save_rollback(@BusinessActionContextParameter(paramName = "params")Trade entity);

}
